using Microsoft.EntityFrameworkCore;
using STF.OrangeDog.Model;
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRazorPages();
var config = builder.Configuration.GetConnectionString("DbCon");
builder.Services.AddControllersWithViews();

builder.Services.AddDbContext<ADbContext>(
    options => options.UseSqlServer(config)
);

var app = builder.Build();



app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSession();
app.UseRouting();
app.UseEndpoints(
    endpoints =>
    endpoints.MapControllerRoute(
        name: "default",
    pattern: "{controller=Home}/{action=index}/{id?}"));
app.UseAuthorization();

app.MapRazorPages();

app.Run();
